#include<stdio.h>
int main() {
	int n;
	int m;
	scanf_s("%d%d", &n, &m);
	int max;
	if (m >n) {
		max = n;
	}
	else {
		max = m;
	}
	while (1) {
		if (n % max == 0 && m % max == 0) {
			printf("最大公约数=%d\n", max);
			break;
		}
		max--;
	}
	return 0;
}